package com.atguigu.classroom.vod.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.atguigu.classroom.model.vod.Subject;
import com.atguigu.classroom.vo.vod.SubjectEeVo;
import com.atguigu.classroom.vod.mapper.SubjectMapper;
import com.atguigu.classroom.vod.service.SubjectService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
public class SubjectListener extends AnalysisEventListener<SubjectEeVo> {
    public static List<Subject> subjectList=new ArrayList<>();
    @Override
    public void invoke(SubjectEeVo subjectEeVo, AnalysisContext analysisContext) {
        Subject subject=new Subject();
        BeanUtils.copyProperties(subjectEeVo,subject);
        subjectList.add(subject);
    }
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {}
}
